package com.marver.login.controller;

import com.marver.common.result.Result;
import com.marver.common.result.ResultStatus;
import com.marver.sys.service.ParamService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping("/param/")
public class ParamsController {

    @Autowired
    private ParamService paramService;
    /**
     * 获取数据字典
     * @throws Exception 
     */
    @RequestMapping(value = "wordbook/{paratype}",method = RequestMethod.POST)
    @ResponseBody
    public Result queryBalance(HttpServletRequest request,@PathVariable String paratype) throws Exception{
        if(StringUtils.isEmpty(paratype)){
        	return new Result(ResultStatus.INVALID_PARAM.getErrorCode());  
        }else{
        	return paramService.getWordBook(paratype);
        }
    } 

}

